Schedule Trigger

Service Watcher

See Also

Introduction to Triggers, Available Triggers

Description

Launches task when the specified service starts, stops, pauses, resumes or stops responding. To indicate partial service names, use wildcard characters * and ?.

Practical Usage

Frequently used to monitor service applications for unexpected crashes.

Parameters

General Tab

Wait for service to

Specifies the time based interval on which the schedule will be based. If the task should run every day, select days, the task should run monthly - select months.

The available options are:

Stop responding: The task will run when the specified service stops responding, "hangs" or crashes.

Start: The task will run when the specified service is started.

Stop: The task will run when the specified service is stopped.

Resume: The task will run when the specified service is resumed (started again after being paused).

Pause: The task will run when the specified service is paused.

Installed: The task will run when the specified service is installed.

Removed: The task will run when the specified  service is removed.

Service Name

Specifies the name of the service to watch. A dropdown populated with currently running services is supplied for convenience. The wildcard characters * and ? may be used, for example e*.exe would watch for all processes starting with the letter e.

Counter Tab

Trigger after condition has been met

Specifies how many times the trigger condition must be met before the task is started. The default is 1. This parameter is available in all triggers except Schedule Watcher.

Trigger Parameters

When this trigger is activated - it automatically populates the AMTrigger object to the task.

The following properties are populated:

Standard Parameters

Parameters available in all triggers.

AMTrigger.Trigger
Text
The name of the trigger that started the task.  For this trigger, the value is set to "AMPROCESSTRIGGER".
AMTrigger.TaskName
Text
The name of the managed task that the trigger was attached to .  This is useful to determine the responsible task when two managed tasks point to the same AML file.
AMTrigger.TriggeredOn
Text
The name of the computer that the task was triggered on.

Trigger-Specific Parameters

Parameters available only in this trigger.

AMTrigger.Action
Text

Specifies the type of wait that the trigger used.

The available returns are:

START: The trigger was set to wait for the service to be started.

STOP: The trigger was set to wait for the process to be stopped.

HUNG: The trigger was set to wait for the service to stop responding

RESUME: The trigger was set to wait for the service to be resumed (started after pause).

PAUSE: The trigger was set to wait for the service to be paused.

INSTALLED: The trigger was set to wait for the service to be installed.

REMOVED: The trigger was set to wait for the service to be removed.

AMTrigger.ServiceName
Text

Returns the short name of the service as shown in the service properties.

AMTrigger.ServiceDisplayName
Text

Returns the display name of the service as the service as shown in the service properties.

AMTrigger.Filename
Text

Returns the path and filename of the service being watched.